Broad-dynamic filtering procedure for a recursive digital filter installed in a signal processor (DSP) operating with integers

ABSTRACT

The present invention relates to a filtering procedure for recursive digital filters installed in signal processors (DSP) operating with integers. It comprises two calculation procedures coupled with the classical calculation procedure of a recursive filter, the first of which, when calculating the output value of the sample, takes into account the remainders of integer divisions by the scale factor, coming from calculating the output values for the previous samples, and the second of which replaces the default value from dividing the integer by a scale factor by the integer value closest to the result of actual division.

BACKGROUND OF THE INVENTION

[0001] The technical field of the present invention is that of recursive digital filters (with infinite impulse response or IIR) and their industrial applications. These filters are used in particular, but not exclusively, in the field of noise reduction, for making active sound protection devices. They can also be used in regulation systems employing negative feedback loops.

[0002] In this area, several designs have already been proposed. They are based on converting an input signal x(n) at a given moment in time, that comes from sampling at a given frequency, into an output signal y(n) deduced therefrom by a specific calculation procedure. The calculation procedure is defined by coefficients a_(j) and b_(i) of the function F(z) representing the filter transfer function in its general form in the complex plane ${F(Z)} = {\frac{1}{K}\quad \frac{\sum\limits_{i = 0}^{P}{b_{i} \cdot Z^{- 1}}}{1 + {\sum\limits_{j = 1}^{q}{a_{j} \cdot Z^{- 1}}}}}$

[0003] or the finite-difference equation which give the value of the output signal as a function of the input and output values for the previous samples n-i or n-j: ${y(n)} = {{\frac{1}{K}{\sum\limits_{i = 0}^{P}\left( {b_{i} \cdot {x\left( {n - i} \right)}} \right)}} - {\sum\limits_{j = 1}^{q}\left( {a_{j} \cdot {y\left( {n - j} \right)}} \right)}}$

[0004] where K designates a coefficient enabling the filter gain to be regulated and Z is a complex number such that Z=exp(2πjf) where f is the reduced frequency, a unitless value between 0 and 1, defined by the actual frequency of the signal expressed in Hz divided by the sampling frequency also expressed in Hz, and where j is the complex number such that j²=1.

[0005] The general form of recursive digital filters can then be represented by the schematic diagram in FIG. 1, where Z⁻¹ is the operator for passing from sample n to sample n−1.

[0006] These filters are generally implemented by a series of second-order filters (filters employing only the input and output values of the two previous samples), disposed in parallel (parallel form) or in a cascade (cascade form), with a transfer function which is then written as follows, for the parallel and cascade filters respectively: ${F(Z)} = {{\prod\limits_{i = 1}^{m}{{F_{i}(Z)}\quad {or}\quad {F(Z)}}} = {\sum\limits_{i = 1}^{m}{F_{i}(Z)}}}$

[0007] where F_(i)(Z) represents the transfer function of each second-order recursive elementary filter.

[0008] Each cell (second-order recursive elementary filter) is thus defined only by the five coefficients a₁, a₂, b₀, b₁, and b₂.

[0009] These filters, of whatever order, have the disadvantage of being implementable only after quantification of their coefficients into integers, namely with truncation of the decimals, which occurs only after the actual coefficients a_(j) and b_(i) have been multiplied by a scale factor. This scale factor increases the possible choice of integer coefficients used in the calculation, while the actual coefficients lie between −2 and 2, at most. This truncation brings about an error which translates into non-linearities of the filter, making it unsuitable for the desired filtering function. To minimize the effect of quantification of integer coefficients, the filter must be made of a succession of second-order filters in a cascade(cascade form). To this error, associated with the coefficients, is added the rounding error that occurs when integers are divided by the scale factor. This rounding error propagates from sample to sample as the calculations are made. It can become very large, hence non-negligible when the filter is operating in the low-frequency range. This error is made even greater if the result of integer divisions by the scale factor is considered to be the default integer value instead of the closest integer value to the result of actual division.

SUMMARY OF THE INVENTION

[0010] The goal of the invention is to remedy these drawbacks by proposing a calculation method that avoids propagation of rounding errors and which uses the closest integer to the result in integer divisions.

[0011] For this purpose, the invention proposes to complete the output signal calculation procedure by taking into account the remainders of integer divisions carried out when the output signal from previous samples is calculated. Further, the invention completes the output signal calculation procedure by a procedure replacing rounding to the default integer value when dividing by the scale factor by rounding to the closest integer of the actual-value result.

BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The invention will be described with reference to the figures in which:

[0013]FIG. 1 is a general form of a recursive digital filter;

[0014]FIG. 2 shows calculation of the output signal for a second order cell;

[0015]FIG. 3 illustrates an improved division procedure;

[0016]FIG. 4 illustrates a rounding error non-propagation procedure; and

[0017]FIG. 5 illustrates a digital active system for hearing protection.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

[0018] The invention completes the output signal calculation procedure by taking into account the remainders of integer divisions carried out when the output signal from the previous samples is calculated. This calculation is done according to the following equation (here indicated in the particular case of a second-order cell): ${y(n)} = {Q\left( \frac{\begin{matrix} {{Q\left( \frac{{{scf} \cdot {x(n)}} + {b_{1} \cdot {x\left( {n - 1} \right)}} + {b_{2} \cdot {x\left( {n - 2} \right)}}}{K} \right)} -} \\ {{a_{1} \cdot {y\left( {n - 1} \right)}} - {a_{2} \cdot {y\left( {n - 2} \right)}} + {Q\left( \frac{{{- a_{1}}{r\left( {n - 1} \right)}} - {a_{1}{r\left( {n - 2} \right)}}}{scf} \right)}} \end{matrix}}{scf} \right)}$ instead of: ${y(n)} = {Q\left( \frac{\begin{matrix} {{Q\left( \frac{{{scf} \cdot {x(n)}} + {b_{1} \cdot {x\left( {n - 1} \right)}} + {b_{2} \cdot {x\left( {n - 2} \right)}}}{K} \right)} -} \\ {{a_{1} \cdot {y\left( {n - 1} \right)}} - {a_{2} \cdot {y\left( {n - 2} \right)}}} \end{matrix}}{scf} \right)}$

[0019] for a classical calculation of an implemented recursive digital filter in which Q( ) is the non-linear quantification operator when integers are divided and “scf” is the scale factor chosen.

[0020] These formulas of course need to be adapted by increasing the number of elements in the calculation (a₁, a₂, a₃, . . . , b₁, b₂, b₃, . . . , n−1, n−2, n−3, . . .) if the filters to be made are multiple-order filters.

[0021] The invention also completes the output signal calculation procedure by a procedure replacing rounding to the default integer value when dividing by the scale factor by rounding to the closest integer of the actual-value result.

[0022] This being the case, it is possible to show that the error between the calculated value y(n) and the theoretical value th(n) that would be obtained without the rounding errors is independent of the errors committed in the previous iterations. Hence there is no more propagation phenomenon and thus no error amplification. The error, of rank n, is thus minimized and the filter obtained can carry out its filtering function whatever the amplitude of the input signal. The dynamics of the filter thus made may exceed 60 dB, i.e. the error remains negligible even if the amplitude of the input signal is between the maximum amplitude and the maximum amplitude minus 60 dB (maximum amplitude/1000).

[0023] Principally, the invention involves a rounding error non-propagation procedure, illustrated in FIG. 4, in which:

[0024] the output signal is picked up and multiplied by the scale factor; and after changing the sign of the result, the result is added to the value of the output signal obtained before dividing by the scale factor to obtain the remainder of integer division of rank n;

[0025] operator Z⁻¹ is applied to the remainder to obtain the remainder of division in the calculation of the sample of rank n−1, to which multiplication by the coefficient −a₁, is applied;

[0026] operator Z⁻¹ is applied to this value once again to obtain the remainder of division in the calculation of the sample of rank n−2, to which multiplication by the coefficient −a₂ is applied;

[0027] and so forth up to the rank used for the filter order; and

[0028] the results are summed, the resulting sum is divided by the scale factor, and the value thus obtained is added to the calculation of the output signal.

[0029] The calculation procedure defined in the invention also advantageously, but not necessarily, involves a procedure known as an improved division procedure, illustrated in FIG. 3, which consists of dividing the signal by the scale factor and then multiplying it again by the scale factor to subtract it from the initial signal; the result of this subtraction is multiplied by two and then divided by the scale factor and finally added to the initial signal after dividing the latter by the scale factor.

[0030] FIGS. 2 to 4 illustrate the calculation procedure according to the invention, limited to a second-order cell. For a digital filter made of m second-order cells in cascade, the invention consists of applying, for each of the m cells, the calculation of its output signal which is shown in FIG. 2. The input signal of the i-th cell is the output signal of the previous cell.

[0031]FIG. 2 shows the complete procedure for a second-order cell, with identification of the rounding error non-propagation procedure by a dot-dashed line (alternating dots and dashes) and the letter A placed in an ellipse, and identification of the improved division procedure by a dotted line and the letter B also placed in an ellipse. In the figure, x(n) is the input signal, y(n) is the output signal, and r(n) is the remainder of dividing by the scale factor. Assuming that the digital filter is composed of several second-order cells in cascade, the procedure must be repeated for each one.

[0032]FIG. 3 shows an improved division procedure, separately from the complete procedure for calculating the output signal for a second-order cell.

[0033]FIG. 4 shows the complete calculation procedure for a second-order cell when it is carrying out only the rounding error non-propagation procedure. Assuming that the digital filter is composed of several second-order cells in cascade, the procedure must be repeated for each cell.

[0034]FIG. 5 summarizes a digital active system for hearing protection, based on the filtering which is the subject of the invention. The upper dashed line represents the protective helmet and the lower dashed line, the digital filter. The DAC and ADC modules represent the digital/analog and analog/digital converters which, associated with signal processor DSP, are the components of the digital filter.

[0035] A particular embodiment of the invention is shown in FIG. 2. In this example it is made of a single second-order cell. The signal x(n) entering upon iteration n is multiplied by the scale factor; it is added to the two values obtained by multiplying the signals entering upon iterations n−1 and n−2 by the coefficients b₁, and b₂, respectively. The value thus obtained is divided by the gain K used for the second-order cell. The following are added to this value:

[0036] the values obtained by multiplying the exiting signals from iterations n−1 and n−2 by coefficients (−a₁) and (−a₂), respectively; and

[0037] the result of the calculation known as the rounding error non-propagation calculation, namely the value obtained by subtracting, from the value arrived at by this sum, the value of the output signal y(n) after multiplication by the scale factor, then applying to this value the operator Z⁻¹ to obtain the remainder of dividing by the scale factor that comes from calculating the output signal for sample n−1, then again applying this operator to obtain the remainder of dividing by the scale factor that comes from calculating the output signal for sample n−2, then summing these remainders after multiplication by coefficients (−a₁) and (−a₂) respectively and, finally, dividing by the scale factor.

[0038] The value emerging from this calculation is then modified to obtain the output value y(n) by the procedure known as the improved division procedure, which comprises picking up the signal coming from the sum operator, dividing it by the scale factor, then multiplying it again by the scale factor to subtract it from the signal as picked up, then multiplying this result by two then dividing it by the scale factor, and finally adding it to the signal as picked up once the latter has been divided by the scale factor.

[0039] Implementation in a DSP type signal processor working with integers of a filter of the type described in the invention can be effected as follows:

[0040] An analogic/digital and digital/analog signal converter is used upstream and downstream of the signal processor, the signal processor preferably having preferably 16 bits or more so that that the error due to conversions is negligible compared to the signal amplitude.

[0041] To avoid an additional error by exceeding the dynamics of the DSP, an integer less than or equal to 2^(p-b-2) is chosen as the scale factor, where p designates the length of the DSP words and b designates the resolution of the converters (number of bits on which the converters code the signal).

[0042] It is preferable to use a scale factor and a gain coefficient K that are multiples of two in order to minimize calculation time. In this way, all dividing, which is slow in a DSP, can be replaced by register shifts which are much faster.

[0043] Finally, the larger the scale factor, the smaller the error due to quantification of the coefficients and the larger the number of filters that can be made. Hence it is preferable to use a DSP with a word length of 32 bits. This enables the value ech=2³²⁻¹⁶⁻²=2¹⁴=16384 to be taken for the scale factor.

[0044] With a filter of this type, signal dynamics exceeding 60 dB can be effectively filtered.

[0045] One practical application of these filters is active noise protection, which requires a broad usable amplitude range whatever the filter implemented. The digital filter then used is an IIR type filter in its cascade form. Each filtering cell is implemented in the DSP using the calculation procedure according to the invention represented in FIG. 2.

[0046] The invention can also be used for regulation, using negative feedback loops, because the low error propagation level can enable analog filtering procedures to be replaced by digital procedures. 

What is claimed is:
 1. A calculation method for producing a recursive digital filter, implemented in a signal processor working with integers, comprising a stage of calculating the output signal of sample n based on an algebraic sum of input and output values of signals sampled at the point in time considered and at previous points in time, to which coefficients characteristic of the filter have been assigned, wherein the stage is coupled with two other calculation stages, in one calculation stage the scale factor chosen is applied to the remainders of the integer divisions, the remainders being the result of calculating the output signals of the previous samples, and in the other calculation stage rounding to the default integer value coming from dividing the output signal by the scale factor is replaced by rounding to the closest integer to the real-number quotient.
 2. A calculation method for producing a recursive digital filter, implemented in a signal processor working with integers, comprising a stage of calculating the output signal of sample n based on an algebraic sum of input and output values of signals sampled at the point in time considered and at previous points in time, to which coefficients characteristic of the filter have been assigned, wherein the stage is coupled with another calculation stage in which the scale factor chosen is applied to the remainders of the integer divisions, the remainders being the result of calculating the output signals of the previous samples.
 3. A calculation method for producing a recursive digital filter, implemented in a signal processor working with integers, comprising a stage of calculating the output signal of sample n based on an algebraic sum of input and output values of signals sampled at the point in time considered and at previous points in time, to which coefficients characteristic of the filter have been assigned, wherein the stage is coupled with another calculation stage in which rounding to the default integer value coming from dividing the output signal by the scale factor is replaced by rounding to the closest integer to the real-number quotient.
 4. A recursive digital filter produced by using the calculation method according to claim
 1. 5. A recursive digital filter produced by using the calculation method according to claim
 2. 6. A recursive digital filter produced by using the calculation method according to claim
 3. 7. An active sound protection system using the recursive digital filter according to claim
 4. 8. An active sound protection system using the recursive digital filter according to claim
 5. 9. An active sound protection system using the recursive digital filter according to claim
 6. 10. A negative feedback regulation system using the recursive digital filter according to claim
 4. 11. A negative feedback regulation system using the recursive digital filter according to claim
 5. 12. A negative feedback regulation system using the recursive digital filter according to claim
 6. 